import Vue from 'vue'
import VueRouter from 'vue-router'
// import { Message } from 'element-ui';
import { checkLoginExpiry, clearAuth } from '@/untils/checkLoginOut'
// import Index from '../views/index/index.vue'
// layout(布局)
//导入需要的组件
import Login from "../views/login/Login.vue"
import Layout from "../views/layout/Layout.vue"
import Account from "../views/account/Account.vue"
import bed from "../views/account/bed.vue"
import SystemCatalogue from "../views/systemCatalogue/xicheng/SystemCatalogue.vue"
import system from "../views/system/system.vue"
import docAdvice from "../views/systemCatalogue/docAdvice/docAdvice.vue"
import watermark from "@/untils/watermark";

// 解决路由重复报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)
// Vue.use(Message)

const routes = [
    // index
    {
        path: "/",
        component: Layout,
        redirect: "/home",//重定向
        name: 'home',
        permission: 'home',
        children: [
            {
                path: "/home",
                meta: {title: '', path: "/"},
                component: () => import("../views/index/index.vue")
            }
        ]
    },
    //系统管理
    {
        path: "/system",
        permission: 'system',
        component: Layout,
        redirect: "/user/index",
        meta: {path: "/user/index", title: "系统管理"},
        children: [
            {
                path: "/user/index",
                permission: 'user',
                meta: {title: '用户管理', path: "/user/index"},
                component: () => import("../views/system/user/index.vue"),
            },
            {
                path: "/role/index",
                permission: 'role',
                meta: {title: '角色管理', path: "/role/index"},
                component: () => import("../views/system/role/index.vue")
            },
            {
                path: "/menu/index",
                permission: 'menu',
                meta: {title: '菜单管理', path: "/menu/index"},
                component: () => import("../views/system/menu/index.vue")
            },
            // 用户新增
            {
                path: "/cinic/index",
                meta: {title: '诊所管理', path: "/cinic/index"},
                component: () => import("../views/system/cinic/index.vue")
            },
            // 系统参数
            {
                path: "/systemCatalogue/systemParameter",
                meta: {title: '诊所管理', path: "/cinic/index"},
                component: () => import("@/views/systemCatalogue/systemParameter/systemParameter.vue")
            },
        ]
    },
    // 打印模板
    {
        path: "/PrintTemplateDesigner",
        component: Layout,
        children: [
            {
                path: "/PrintTemplateDesigner",
                meta: { title: '打印模板', path: "/PrintTemplateDesigner" },
                component: () => import("../components/PrintTemplateDesigner.vue")
            }
        ]
    },
    // 科室档案
    {
        path: "/deptAbout",
        component: Layout,
        children: [
            {
                path: "/deptAbout",
                meta: { title: '打印模板', path: "/deptAbout" },
                component: () => import("@/views/reservation/dept/dept.vue")
            }
        ]
    },
    // 卫材目录
    {
        path: "/reservation/Eisai",
        component: Layout,
        children: [
            {
                path: "/reservation/Eisai",
                meta: { title: '卫材目录', path: "/Eisai" },
                component: () => import("@/views/reservation/Eisai/Eisai.vue")
            }
        ]
    },
    //登录
    {
        path: "/login",
        name: 'login',
        component: Login,
    },
    //诊疗工作站
    {
        path: "/Stag",
        component: Layout,
        redirect: "/Stag/DocStag",
        meta: {path: "/", title: "诊疗工作站"},
        children: [
            {
                path: "/Stag/DocStag",
                meta: {path: "/Stag/DocStag", title: '医生工作站'},
                component: () => import("../views/Stag/DocStag.vue"),
            },
            {
                path: "/Stag/HealStag",
                meta: {path: "/Stag/HealStag", title: '治疗工作站'},
                component: () => import("../views/Stag/HealStag.vue"),
            },
            {
                path: "/Stag/OutpatStag",
                meta: {path: "/Stag/OutpatStag", title: '门诊病历系统'},
                component: () => import("../views/Stag/OutpatStag.vue"),
            },
            {
                path: "/Stag/industrialStag",
                meta: {path: "/Stag/industrialStag", title: '一体化工作站'},
                component: () => import("../views/Stag/industrialStag.vue"),
            },
        ]
    },
    // 进销存管理
    {
        path: "/PSI",
        component: Layout,
        redirect: "/PSI/shopPlan",
        meta: {path: "/", title: "库存管理"},
        children: [
            {
                path: "/PSI/shopPlan",
                meta: {path: "/PSI/shopPlan", title: '采购计划'},
                component: () => import("@/views/PSI/plan/shopPlan.vue"),
            },
            {
                path: "/PSI/shopStore",
                meta: {path: "/PSI/shopStore", title: '采购入库'},
                component: () => import("@/views/PSI/putInstore/shopStore.vue"),
            },
            {
                path: "/PSI/putOthersInstore",
                meta: {path: "/PSI/putOthersInstore/putOthersInstore", title: '其他入库'},
                component: () => import("@/views/PSI/putOthersInstore/putOthersInstore.vue"),
            },
            {
                path: "/PSI/WesternPriceChance",
                meta: {path: "/PSI/WesternPriceChance/WesternPriceChance", title: '西药库零售调价'},
                component: () => import("@/views/PSI/WesternPriceChance/WesternPriceChance.vue"),
            },
            {
                path: "/PSI/westernWaring",
                meta: {path: "/PSI/WesternPriceChance/westernWaring", title: '西药库存预警'},
                component: () => import("@/views/PSI/westernWaring/westernWaring.vue"),
            },
            {
                path: "/PSI/PSIOrder",
                meta: {path: "/PSI/shopStore", title: '结算清单'},
                component: () => import("../views/PSI/PSIOrder.vue"),
            },
            {
                path: "/PSI/shopReturn",
                meta: {path: "/PSI/shopReturn", title: '采购退货'},
                component: () => import("../views/PSI/shopReturn/shopReturn.vue"),
            },
            {
                path: "/PSI/shopDispensing",
                meta: {path: "/PSI/shopDispensing", title: "处方发药"},
                component: () => import("../views/PSI/shopDispensing.vue"),
            },
            {
                path: "/PSI/shopMangnier",
                meta: {path: "/PSI/shopMangnier", title: '处方管理'},
                component: () => import("../views/PSI/shopMangnier.vue"),
            },
            {
                path: "/PSI/allocate",
                meta: {path: "/PSI/allocate", title: '西药调拨'},
                component: () => import("../views/PSI/allocate/allocate.vue"),
            },
            {
                path: "/PSI/shopBack",
                meta: {path: "/PSI/shopBack", title: "处方退药"},
                component: () => import("../views/PSI/shopBack.vue"),
            },
            {
                path: "/PSI/warnStore",
                meta: {path: "/PSI/warnStore", title: '预警管理'},
                component: () => import("../views/PSI/warnStore.vue"),
            },
            {
                path: "/PSI/InventoryCount",
                meta: {path: "/PSI/InventoryCount", title: '库存盘点'},
                component: () => import("@/views/PSI/InventoryCount/InventoryCount.vue"),
            },
            {
                path: "/PSI/InventoryCount/details",
                meta: {path: "/PSI/InventoryCount/details", title: '【西药库】库存盘点明细'},
                component: () => import("@/views/PSI/InventoryCount/Countdetails.vue"),
            },
            {
                path: "/PSI/DrugInventory",
                meta: {path: "/PSI/DrugInventory", title: "药品库存"},
                component: () => import("../views/PSI/DrugInventory/DrugInventory.vue"),
            },
            {
                path: "/PSI/ChangeDetailsTable",
                meta: {path: "/PSI/ChangeDetailsTable", title: "变化明细表"},
                component: () => import("../views/PSI/ChangeDetailsTable/ChangeDetailsTable.vue"),
            },
            {
                path: "/PSI/periodManger",
                meta: {path: "/PSI/periodManger", title: '效期管理'},
                component: () => import("../views/PSI/periodManger.vue"),
            },
            {
                path: "/PSI/TraceabilityCode",
                meta: {path: "/PSI/TraceabilityCode", title: "追溯码管理"},
                component: () => import("../views/PSI/TraceabilityCode.vue"),
            },
        ]
    },
    // 进销存管理 = > 中药
    {
        path: "/PSI/traMediciplan",
        component: Layout,
        redirect: "/PSI/traMediciplan/traMediciplan",
        meta: {path: "/", title: "中药采购"},
        children: [
            {
                path: "/PSI/traMediciplan/",
                meta: {path: "/PSI/traMediciplan/traMediciplan", title: '中药采购计划'},
                component: () => import("@/views/PSI/traMediciplan/traMediciplan.vue"),
            },
            {
                path: "/PSI/traMediciInstore",
                meta: {path: "/PSI/traMediciplan/traMediciInstore", title: '采购入库'},
                component: () => import("@/views/PSI/traMediciInstore/traMediciStore.vue"),
            },
			{
			    path: "/PSI/traMediciOthersInstore",
			    meta: {path: "/PSI/traMediciOthersInstore/traMediciStore", title: '【中药库】其他入库'},
			    component: () => import("@/views/PSI/traMediciOthersInstore/traMediciStore.vue"),
			},
            {
                path: "/PSI/traMediciReturn",
                meta: {path: "/PSI/traMediciReturn/traMediciReturn", title: '采购退货'},
                component: () => import("@/views/PSI/traMediciReturn/traMediciReturn.vue"),
            },
            {
                path: "/PSI/traMediciAllocate",
                meta: {path: "/PSI/traMediciAllocate", title: '中药调拨'},
                component: () => import("@/views/PSI/traMediciAllocate/traMediciAllocate.vue"),
            },
            {
                path: "/PSI/traMediciCount",
                meta: {path: "/PSI/traMediciCount", title: '中药库库存盘点'},
                component: () => import("@/views/PSI/traMediciCount/traMediciCount.vue"),
            },
            {
                path: "/PSI/traMediciCount/details",
                meta: {path: "/PSI/traMediciCount/details", title: '【中药库】库存盘点明细'},
                component: () => import("@/views/PSI/traMediciCount/Countdetails.vue"),
            },
            {
                path: "/PSI/traMediciWaring",
                meta: {path: "/PSI/traMediciWaring", title: '中药库存预警'},
                component: () => import("@/views/PSI/traMediciWaring/traMediciWaring.vue"),
            },
            {
                path: "/PSI/traMediciPharmacy",
                meta: {path: "/PSI/traMediciPharmacy", title: '中药药房申领'},
                component: () => import("@/views/PSI/traMediciPharmacy/traMediciPharmacy.vue"),
            },
            {
                path: "/PSI/inventoryTable",
                meta: {path: "/PSI/inventoryTable", title: '中药库存一览表'},
                component: () => import("@/views/PSI/inventoryTable/inventoryTable.vue"),
            },
        ]
    },
    // 西药房
    {
        path: "/medicenHouse/WesternHouse",
        meta: {path: "/medicenHouse/WesternHouse", title: '西药房'},
        component: Layout,
        children: [
            {
                path: "/medicenHouse/WesternHouse/LocationCatalog",
                meta: {path: "/medicenHouse/WesternHouse/LocationCatalog", title: '货位目录'},
                component: () => import("@/views/medicenHouse/WesternHouse/LocationCatalog/LocationCatalog.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/WesternHouseStore",
                meta: {path: "/medicenHouse/WesternHouse/WesternHouseStore", title: '西药房库存'},
                component: () => import("@/views/medicenHouse/WesternHouse/WesternHouseStore/WesternHouseStore.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/OhtersInstore",
                meta: {path: "/medicenHouse/WesternHouse/OhtersInstore", title: '西药房其他入库'},
                component: () => import("@/views/medicenHouse/WesternHouse/OhtersInstore/OhtersInstore.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/OthersReturn",
                meta: {path: "/medicenHouse/WesternHouse/OthersReturn", title: '西药房其他出库'},
                component: () => import("@/views/medicenHouse/WesternHouse/OthersReturn/OthersReturn.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/deptUseWarning",
                meta: {path: "/medicenHouse/WesternHouse/deptUseWarning", title: '西药房库存预警'},
                component: () => import("@/views/medicenHouse/WesternHouse/deptUseWarning/deptUseWarning.vue"),
            },
			
			{
			    path: "/medicenHouse/WesternHouse/ValidityPeriod",
			    meta: {path: "/medicenHouse/WesternHouse/ValidityPeriod", title: '西药房效期预警'},
			    component: () => import("@/views/medicenHouse/WesternHouse/ValidityPeriod/ValidityPeriod.vue"),
			},

            {
                path: "/WesterHouseCount/WesterHouseCount",
                meta: {path: "/WesterHouseCount/WesterHouseCount", title: '西药房盘点'},
                component: () => import("@/views/medicenHouse/WesternHouse/WesterHouseCount/WesterHouseCount.vue"),
            },
            {
                path: "/WesterHouseCount/details",
                meta: {path: "/WesterHouseCount/details", title: '【西药房】库存盘点明细'},
                component: () => import("@/views/medicenHouse/WesternHouse/WesterHouseCount/Countdetails.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/giveMedici",
                meta: {path: "/medicenHouse/WesternHouse/giveMedici", title: '西药房发药'},
                component: () => import("@/views/medicenHouse/WesternHouse/giveMedici/giveMedici.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/returnMedici",
                meta: {path: "/medicenHouse/WesternHouse/returnMedici", title: '西药房退药'},
                component: () => import("@/views/medicenHouse/WesternHouse/returnMedici/returnMedici.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/OthersReturn",
                meta: {path: "/medicenHouse/WesternHouse/OthersReturn", title: '西药房其他出库'},
                component: () => import("@/views/medicenHouse/WesternHouse/OthersReturn/OthersReturn.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/deptUseWarning",
                meta: {path: "/medicenHouse/WesternHouse/deptUseWarning", title: '西药房库存预警'},
                component: () => import("@/views/medicenHouse/WesternHouse/deptUseWarning/deptUseWarning.vue"),
            },
            {
                path: "/WesterHouseCount/WesterHouseCount",
                meta: {path: "/WesterHouseCount/WesterHouseCount", title: '西药房盘点'},
                component: () => import("@/views/medicenHouse/WesternHouse/WesterHouseCount/WesterHouseCount.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/giveMedici",
                meta: {path: "/medicenHouse/WesternHouse/giveMedici", title: '西药房发药'},
                component: () => import("@/views/medicenHouse/WesternHouse/giveMedici/giveMedici.vue"),
            },
            {
                path: "/medicenHouse/WesternHouse/returnMedici",
                meta: {path: "/medicenHouse/WesternHouse/returnMedici", title: '西药房退药'},
                component: () => import("@/views/medicenHouse/WesternHouse/returnMedici/returnMedici.vue"),
            },

        ]
    },
    // 中药房
    {
        path: "/medicenHouse/traMediciHouse",
        meta: {path: "/medicenHouse/traMediciHouse", title: '中药房'},
        component: Layout,
        children: [
            {
                path: "/medicenHouse/traMediciHouse/traMediciHouseStore",
                meta: {path: "/medicenHouse/traMediciHouse/traMediciHouseStore", title: '中药房库存'},
                component: () => import("@/views/medicenHouse/traMediciHouse/traMediciHouseStore/traMediciHouseStore.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/OthersInstore",
                meta: {path: "/medicenHouse/traMediciHouse/OthersInstore", title: '中药房其他入库'},
                component: () => import("@/views/medicenHouse/traMediciHouse/OthersInstore/OthersInstore.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/OthersReturn",
                meta: {path: "/medicenHouse/traMediciHouse/OthersReturn", title: '中药房其他退库'},
                component: () => import("@/views/medicenHouse/traMediciHouse/OthersReturn/OthersReturn.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/deptUseWarning",
                meta: {path: "/medicenHouse/traMediciHouse/deptUseWarning", title: '中药房库存预警'},
                component: () => import("@/views/medicenHouse/traMediciHouse/deptUseWarning/deptUseWarning.vue"),
            },
            {
                path: "/traMediciHouse/traMediciHouseCount",
                meta: {path: "/traMediciHouse/traMediciHouseCount", title: '中药房盘点'},
                component: () => import("@/views/medicenHouse/traMediciHouse/traMediciHouseCount/traMediciHouseCount.vue"),
            },
            {
                path: "/traMediciHouse/details",
                meta: {path: "/WesterHouseCount/details", title: '【中药房】库存盘点明细'},
                component: () => import("@/views/medicenHouse/traMediciHouse/traMediciHouseCount/Countdetails.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/giveMedici",
                meta: {path: "/medicenHouse/traMediciHouse/giveMedici", title: '中药房发药'},
                component: () => import("@/views/medicenHouse/traMediciHouse/giveMedici/giveMedici.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/returnMedici",
                meta: {path: "/medicenHouse/traMediciHouse/returnMedici", title: '中药房退药'},
                component: () => import("@/views/medicenHouse/traMediciHouse/returnMedici/returnMedici.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/OthersInstore",
                meta: {path: "/medicenHouse/traMediciHouse/OthersInstore", title: '中药房其他入库'},
                component: () => import("@/views/medicenHouse/traMediciHouse/OthersInstore/OthersInstore.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/OthersReturn",
                meta: {path: "/medicenHouse/traMediciHouse/OthersReturn", title: '中药房其他退库'},
                component: () => import("@/views/medicenHouse/traMediciHouse/OthersReturn/OthersReturn.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/deptUseWarning",
                meta: {path: "/medicenHouse/traMediciHouse/deptUseWarning", title: '中药房库存预警'},
                component: () => import("@/views/medicenHouse/traMediciHouse/deptUseWarning/deptUseWarning.vue"),
            },
            {
                path: "/traMediciHouse/traMediciHouseCount",
                meta: {path: "/traMediciHouse/traMediciHouseCount", title: '中药房盘点'},
                component: () => import("@/views/medicenHouse/traMediciHouse/traMediciHouseCount/traMediciHouseCount.vue"),
            },
            {
                path: "/medicenHouse/traMediciHouse/giveMedici",
                meta: {path: "/medicenHouse/traMediciHouse/giveMedici", title: '中药房发药'},
                component: () => import("@/views/medicenHouse/traMediciHouse/giveMedici/giveMedici.vue"),
            },
        ]
    },

    //预约挂号
    {
        path: "/reservation",
        component: Layout,
        redirect: "/reservation/Siting",
        meta: {path: "/", title: "预约挂号"},
        children: [
            {
                path: "/reservation/category",
                meta: {path: "/reservation/category", title: '挂号类别'},
                component: () => import("../views/reservation/Categorys/category.vue"),
            },
            {
                path: "/reservation/clinicSchedule",
                meta: {path: "/reservation/clinicSchedule", title: '坐诊'},
                component: () => import("../views/reservation/clinicSchedule/clinicSchedule.vue"),
            },
            {
                path: "/reservation/charge",
                meta: {path: "/reservation/charge", title: '收费项目'},
                component: () => import("../views/reservation/charge.vue"),
            },
            {
                path: "/reservation/Healthrecords",
                meta: {path: "/reservation/Healthrecords", title: '健康档案'},
                component: () => import("../views/reservation/Healthrecords/Healthrecords.vue"),
            },
            {
                path: "/reservation/Siting",
                meta: {path: "/reservation/Siting", title: '坐诊管理'},
                component: () => import("../views/reservation/Siting.vue"),
            },
            {
                path: "/reservation/Scheduling",
                meta: {path: "/reservation/Scheduling", title: '坐诊排班'},
                component: () => import("../views/reservation/Scheduling.vue"),
            },
            {
                path: "/reservation/reservation",
                meta: {path: "/reservation/reservation", title: '挂号'},
                component: () => import("../views/reservation/reservation.vue"),
            },
            {
                path: "/reservation/reservationList",
                meta: {path: "/reservation/reservationList", title: '挂号列表'},
                component: () => import("../views/reservation/reservationList.vue"),
            },
            {
                path: "/reservation/outpatientPhysician",
                meta: {path: "/reservation/outpatientPhysician", title: '门诊医师'},
                component: () => import("../views/reservation/outpatientPhysician.vue"),
            },
            {
                path: "/reservation/caseHistoryTemplate",
                meta: {path: "/reservation/caseHistoryTemplate", title: '病历模板'},
                component: () => import("../views/reservation/caseHistoryTemplate/caseHistoryTemplate.vue"),
            },
            {
                path: "/reservation/outpatientCharge",
                meta: {path: "/reservation/outpatientCharge", title: '门诊收费'},
                component: () => import("../views/reservation/outpatientCharge.vue"),
            },
            {
                path: "/reservation/onCreditType",
                meta: {path: "/reservation/onCreditType", title: '挂账类型'},
                component: () => import("../views/reservation/onCreditType/onCreditType.vue"),
            },
            {
                path: "/reservation/outpatientChargeList",
                meta: {path: "/reservation/outpatientChargeList", title: '收费列表'},
                component: () => import("../views/reservation/outpatientChargeList.vue"),
            },

            {
                path: "/reservation/outpatientNurse",
                meta: {path: "/reservation/outpatientNurse", title: '门诊护士'},
                component: () => import("../views/reservation/outpatientNurse.vue"),
            },
            {
                path: "/ybRecord/ybRecordLog",
                meta: { path:"/ybRecord/ybRecordLog", title: '医保日志'},
                component: () => import("../views/ybRecord/ybRecordLog.vue"),
            },
            {
                path: "/reservation/seedoctorKeyword/seedoctorKeyword",
                meta: {path: "/reservation/seedoctorKeyword/seedoctorKeyword", title: '病历关键字'},
                component: () => import("../views/reservation/seedoctorKeyword/seedoctorKeyword.vue"),
            },
            {
                path: "/reservation/westernMedicineList/westernMedicineList",
                meta: {path: "/reservation/westernMedicineList/westernMedicineList", title: '西药处方列表'},
                component: () => import("../views/reservation/westernMedicineList/westernMedicineList.vue"),
            },
            {
                path: "/reservation/chinaMedicineList/chinaMedicineList",
                meta: {path: "/reservation/chinaMedicineList/chinaMedicineList", title: '中药处方列表'},
                component: () => import("../views/reservation/chinaMedicineList/chinaMedicineList.vue"),
            },
        ]
    },
    //系统目录
    {
        path: "/systemCatalogue",
        component: Layout,
        redirect: "/systemCatalogue/MedicenCata",
        meta: {path: "/", title: "公共目录"},
        children: [
            {
                path: "/systemCatalogue/area",
                meta: {path: "/systemCatalogue/area", title: '行政区域'},
                component: () => import("../views/systemCatalogue/area.vue"),
            },
            {
                path: "/systemCatalogue/institution",
                meta: {path: "/systemCatalogue/institution", title: '机构列表'},
                component: () => import("../views/systemCatalogue/institution.vue"),
            },
            {
                path: "/systemCatalogue/CampusAreas",
                meta: {path: "/systemCatalogue/CampusAreas", title: '院区列表'},
                component: () => import("../views/systemCatalogue/CampusAreas.vue"),
            },
            {
                path: "/systemCatalogue/ClinicalDepartment",
                meta: {path: "/systemCatalogue/ClinicalDepartment", title: '临床科别'},
                component: () => import("../views/systemCatalogue/ClinicalDepartment.vue"),
            },
            {
                path: "/systemCatalogue/PersonnelRelated",
                meta: {path: "/systemCatalogue/PersonnelRelated", title: '人员相关'},
                component: () => import("../views/systemCatalogue/PersonnelRelated.vue"),
            },
            {
                path: "/systemCatalogue/charging",
                meta: {path: "/systemCatalogue/charging", title: '收费项目'},
                component: () => import("../views/systemCatalogue/charging/charging.vue"),
            },
            {
                path: "/systemCatalogue/chargingPrice",
                meta: { path:"/systemCatalogue/chargingPrice", title: '项目价格'},
                component: () => import("../views/systemCatalogue/chargingPrice/chargingPrice.vue"),
            },
            {
                path: "/systemCatalogue/cosrute",
                meta: { path:"/systemCatalogue/cosrute", title: '给药方式对照'},
                component: () => import("../views/systemCatalogue/cosrute/Cosrute.vue"),
            },
            {
                path: "/supplier",
                meta: { path:"/supplier", title: '供货单位'},
                component: () => import("../views/reservation/supplier/supplier.vue"),
            },
			{
			    path: "/customer/contractDept",
			    meta: {path: "/customer/contractDept", title: '合约单位'},
			    component: () => import("../views/customer/contractDept/contractDept.vue"),
			},
			{
			    path: "/Acc/acc-list",
			    meta: { path:"/Acc/acc-list", title: '人员相关'},
			    component: () => import("../views/account/AccList.vue"),
			},
            {
                path: "/customer/contractDept",
                meta: {path: "/customer/contractDept", title: '合约单位'},
                component: () => import("../views/customer/contractDept/contractDept.vue"),
            },
            {
                path: "/Acc/acc-list",
                meta: { path:"/Acc/acc-list", title: '人员相关'},
                component: () => import("../views/account/AccList.vue"),
            },
            {
                path: "/systemCatalogue/Western/Western",
                meta: { path:"/systemCatalogue/Western/Western", title: '西成药品'},
                component: SystemCatalogue,
                children: [
                    {
                        path: "/systemCatalogue/Western/Western",
                        meta: { path:"/systemCatalogue/Western/Western", title: '西药目录'},
                        component: () => import("../views/systemCatalogue/Western/Western.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/XichengMedicine",
                        meta: { path:"/systemCatalogue/xicheng/XichengMedicine", title: '优化西药目录'},
                        component: () => import("../views/systemCatalogue/xicheng/XichengMedicine.vue"),
                    },
                    {
                        path: "/systemCatalogue/markUp",
                        meta: { path:"/systemCatalogue/markUp/markUp", title: '药品加成率'},
                        component: () => import("../views/systemCatalogue/markUp/markUp.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/packing",
                        meta: { path:"/systemCatalogue/xicheng/packing", title: '包装单位'},
                        component: () => import("../views/systemCatalogue/xicheng/packing.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/metering",
                        meta: { path:"/systemCatalogue/xicheng/metering", title: '计量单位'},
                        component: () => import("../views/systemCatalogue/xicheng/metering.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/dose",
                        meta: { path:"/systemCatalogue/xicheng/dose", title: '剂量单位'},
                        component: () => import("../views/systemCatalogue/xicheng/dose.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/Dosage",
                        meta: { path:"/systemCatalogue/xicheng/Dosage", title: '药品剂型'},
                        component: () => import("../views/systemCatalogue/xicheng/Dosage.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/Pharmacological",
                        meta: { path:"/systemCatalogue/xicheng/Pharmacological", title: '药理类别'},
                        component: () => import("../views/systemCatalogue/xicheng/Pharmacological.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/prescription",
                        meta: { path:"/systemCatalogue/xicheng/prescription", title: '处方类型'},
                        component: () => import("../views/systemCatalogue/xicheng/prescription.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/Poisonous",
                        meta: { path:"/systemCatalogue/xicheng/Poisonous", title: '毒麻类型'},
                        component: () => import("../views/systemCatalogue/xicheng/Poisonous.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/precious",
                        meta: { path:"/systemCatalogue/xicheng/precious", title: '贵重类型'},
                        component: () => import("../views/systemCatalogue/xicheng/precious.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/WinningTheBidgrades",
                        meta: { path:"/systemCatalogue/xicheng/WinningTheBidgrades", title: '中标等级'},
                        component: () => import("../views/systemCatalogue/xicheng/WinningTheBidgrades.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/clinical",
                        meta: { path:"/systemCatalogue/xicheng/clinical", title: '临床用途'},
                        component: () => import("../views/systemCatalogue/xicheng/clinical.vue"),
                    },
                    {
                        path: "/systemCatalogue/xicheng/classlimit",
                        meta: { path:"/systemCatalogue/xicheng/classlimit", title: '药品分类限制'},
                        component: () => import("../views/systemCatalogue/xicheng/classlimit.vue"),
                    },
                ]
            },
            {
                path: "",
                meta: { path:"/systemCatalogue/traMedici", title: '中草药品'},
                component: SystemCatalogue,
                children: [
                    {
                        path: "/systemCatalogue/traMedici",
                        meta: { path:"/systemCatalogue/traMedici/traMedici", title: '中药目录'},
                        component: () => import("../views/systemCatalogue/traMedici/traMedici.vue"),
                    },
                ]
            },
            {
                path: "/systemCatalogue/herbal",
                meta: { path:"/systemCatalogue/herbal", title: '中药药品'},
                component: () => import("../views/systemCatalogue/herbal.vue"),
            },
            {
                path: "/systemCatalogue/HygienicMaterials",
                meta: { path:"/systemCatalogue/HygienicMaterials", title: '卫生材料'},
                component: () => import("../views/systemCatalogue/HygienicMaterials.vue"),
            },
        ]
    },


    //移动支付
    {
        path: "/PayforMedicen",
        component: Layout,
        redirect: "/PayforMedicen/PayforScheduling",
        meta:{ path:"/PayforMedicen/PayforScheduling",title:"预约挂号" },
        children: [
            {
                path: "/PayforMedicen/PayforScheduling",
                meta: { path:"/PayforMedicen/PayforScheduling", title: '预约挂号'},
                component: () => import("../views/PayforMedicen/PayforScheduling.vue"),
            },
            {
                path: "/PayforMedicen/PayforRoom",
                meta: { path:"/PayforMedicen/PayforRoom", title: '诊疗诊间'},
                component: () => import("../views/PayforMedicen/PayforRoom.vue"),
            },
            {
                path: "/PayforMedicen/Gateway",
                meta: { path:"/PayforMedicen/Gateway", title: '聚合支付'},
                component: () => import("../views/PayforMedicen/Gateway.vue"),
            },
            {
                path: "/PayforMedicen/getWays",
                meta: { path:"/PayforMedicen/getWays", title: '聚合支付'},
                component: () => import("../views/PayforMedicen/getWays.vue"),
            }
        ]
    },
    // 消息管理
    {
        path: "/messages",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '消息管理', path: "/messages" },
                component: () => import("@/views/messages/messages.vue")
            }
        ]
    },
	// 设置管理
	{
	    path: "/baseInfo",
	    component: Layout,
	    children: [
	        {
	            path: "/",
	            meta: { title: '设置管理', path: "/baseInfo" },
	            component: () => import("@/views/baseInfo/baseInfo.vue")
	        }
	    ]
	},
    //药店 / 诊所管理
    {
        path: "/Shop",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '诊所管理', path: "/Shop" },
                component: () => import("../views/shop/Shop.vue")
            }
        ]
    },
    // 工具
    {
        path: "/Acc",
        component: Layout,
        redirect: "/Acc/acc-list",
        meta:{ path:"/Acc",title:"工具" },
        children: [
            {
                path: "/Acc/tool",
                meta: { path:"/Acc/tool", title: '调试工具'},
                component: () => import("../views/account/tool.vue"),
            },
            {
                path: "/Acc/bed",
                meta: { path:"/Acc/bed", title: '科室床位'},
                component: () => import("../views/account/bed.vue"),
            },
            {
                path: "/Acc/xcy",
                meta:{ path:"/Acc/xcy", title:"西成药品"},
                component: () => import("../views/account/xcy.vue"),
            },
            {
                path: "/Acc/zcy",
                meta:{ path:"/Acc/zcy", title:"中草药品"},
                component: () => import("../views/account/zcy.vue"),
            },
            // {
            //   path: "/docAdvice",
            //   meta: { path:"/docAdvice", title: '医嘱相关'},
            //   component: () => import("../views/SystemCatalogue/docAdvice/GiveWays.vue"),

            // },
        ]
    },
    //订单管理
    {
        path: "/Order",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '订单管理', path: "/Order" },
                component: () => import("../views/order/Order.vue")
            }
        ]
    },
    // 客服
    {
        path: "/customer",
        component: Layout,
        redirect: "/customer",
        meta:{ path:"/customer",title:"客服" },
        children: [
            {
                path: "/customer/files",
                meta: { path:"/customer/files", title: '客户档案'},
                component: () => import("../views/customer/files/files.vue"),
            },
            {
                path: "/customer/contractDept",
                meta: { path:"/customer/contractDept", title: '合约单位'},
                component: () => import("../views/customer/contractDept/contractDept.vue"),
            },
        ]
    },

    //患者管理
    {
        path: "/files",
        component: Layout,
        redirect: "/files/files",
        meta:{ path:"/files",title:"患者管理" },
        children: [
            {
                path: "/files/files",
                meta: { path:"/files/files", title: '基本信息'},
                component: () => import("../views/files/files.vue"),
            },
            {
                path: "/files/Recharge",
                meta: { path:"/files/Recharge", title: '患者充值'},
                component: () => import("../views/files/Recharge.vue"),
            },
            {
                path: "/files/visited",
                meta: { path:"/files/visited", title: '患者回访'},
                component: () => import("../views/files/visited.vue"),
            },
            {
                path: "/files/activity",
                meta:{ path:"/files/activity", title:"优惠活动"},
                component: () => import("../views/files/activity.vue"),
            },
        ]
    },
    //收费管理
    {
        path: "/charge",
        component: Layout,
        redirect: "/charge/charge",
        meta:{ path:"/charge",title:"收费管理" },
        children: [
            {
                path: "/charge/charge",
                meta: { path:"/charge/charge", title: '诊疗收费'},
                component: () => import("../views/charge/charge.vue"),
            },
            {
                path: "/charge/Closing",
                meta: { path:"/charge/Closing", title: '结班管理'},
                component: () => import("../views/charge/Closing.vue"),
            }
        ]
    },
    //登记信息
    {
        path: "/register",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '登记信息', path: "/register" },
                component: () => import("../views/register/register.vue")
            }
        ]
    },
    //医生门诊
    {
        path: "/outpatient",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '医生门诊', path: "/outpatient" },
                component: () => import("../views/outpatient/outpatient.vue")
            }
        ]
    },
    //不合理处方查询
    {
        path: "/prescripQuery",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '不合理处方查询', path: "/prescripQuery" },
                component: () => import("../views/prescripQuery/prescripQuery.vue")
            }
        ]
    },
    //  顶部tabs1
    {
        path: "/Tabs1",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '暂定标签0', path: "/Tabs" },
                component: () => import("../views/tabs/Tabs1.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 收费发药 inventory
    // {
    //   path: "/PayforMedicen",
    //   component: Layout,
    //   children: [
    //     {
    //       path: "/",
    //   		  meta: { title: '收费发药', path: "/PayforMedicen" },
    //       component: () => import("../views/PayforMedicen/PayforMedicen.vue")
    //     }
    //   ]
    // },
    // 顶部tabs2-Choose 治疗 treatment
    {
        path: "/treatment",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '治疗', path: "/treatment" },
                component: () => import("../views/treatment/treatment.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 报表查询 tableQuery
    {
        path: "/tableQuery",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '报表查询', path: "/tableQuery" },
                component: () => import("../views/tableQuery/tableQuery.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 库存管理 inventory
    {
        path: "/inventory",
        component: Layout,
        children: [
            {
                path: "/",
                meta: { title: '库存管理', path: "/inventory" },
                component: () => import("../views/inventory/inventory.vue")
            }
        ]
    },
    // 跳转页面 采购入库单
    {
        path: "/shopOrder",
        component: Layout,
        children: [
            {
                path: "/shopOrder",
                meta: { title: '采购入库单', path: "/shopOrder" },
                component: () => import("../external/shopStore/StoreOrder.vue")
            }
        ]
    },
    // 独立页面 工作台
    {
        path: "/workJob",
        component: Layout,
        children: [
            {
                path: "/workJob",
                meta: { title: '采购入库单', path: "/workJob" },
                component: () => import("../views/index/workJob.vue")
            }
        ]
    },
    // 测试404
    {
        path: "/test",
        component: Layout,
        children: [
            {
                path: "/test",
                meta: { title: '测试404', path: "/test" },
                component: () => import("../views/404.vue")
            }
        ]
    },
    // 跳转页面 忘记密码
    {
        path: "/forgetPassword",
        meta: { title: '忘记密码', path: "/forgetPassword" },
        component: () => import("../views/login/forgetPassword.vue")
    },
    // 跳转页面 个人中心
    {
        path: "/profile",
        component: Layout,
        children: [
            {
                path: "/profile",
                meta: { title: '个人中心', path: "/profile" },
                component: () => import("../views/account/UserInfo.vue")
            }
        ]
    },

    //移动支付
    {
        path: "/PayforMedicen",
        component: Layout,
        redirect: "/PayforMedicen/PayforScheduling",
        meta: {path: "/PayforMedicen/PayforScheduling", title: "预约挂号"},
        children: [
            {
                path: "/PayforMedicen/PayforScheduling",
                meta: {path: "/PayforMedicen/PayforScheduling", title: '预约挂号'},
                component: () => import("../views/PayforMedicen/PayforScheduling.vue"),
            },
            {
                path: "/PayforMedicen/PayforRoom",
                meta: {path: "/PayforMedicen/PayforRoom", title: '诊疗诊间'},
                component: () => import("../views/PayforMedicen/PayforRoom.vue"),
            },
            {
                path: "/PayforMedicen/thirdpartyPayment",
                meta: { path:"/PayforMedicen/thirdpartyPayment", title: '聚合支付'},
                component: () => import("../views/PayforMedicen/thirdpartyPayment.vue"),
            },
            {
                path: "/PayforMedicen/payOrder",
                meta: { path:"/PayforMedicen/payOrder", title: '支付订单'},
                component: () => import("../views/PayforMedicen/payOrder.vue"),
            },
        ]
    },
    //药店 / 诊所管理
    {
        path: "/Shop",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '诊所管理', path: "/Shop"},
                component: () => import("../views/shop/Shop.vue")
            }
        ]
    },
    //目录
    {
        path: "/Acc",
        component: Layout,
        redirect: "/Acc/acc-list",
        meta: {path: "/Acc", title: "目录"},
        children: [
            {
                path: "/Acc/tool",
                meta: {path: "/Acc/tool", title: '调试工具'},
                component: () => import("../views/account/tool.vue"),
            },
            {
                path: "/Acc/bed",
                meta: {path: "/Acc/bed", title: '科室床位'},
                component: () => import("../views/account/bed.vue"),
            },
            {
                path: "/Acc/acc-list",
                meta: {path: "/Acc/acc-list", title: '人员相关'},
                component: () => import("../views/account/AccList.vue"),
            },
            {
                path: "/Acc/xcy",
                meta: {path: "/Acc/xcy", title: "西成药品"},
                component: () => import("../views/account/xcy.vue"),
            },
            {
                path: "/Acc/zcy",
                meta: {path: "/Acc/zcy", title: "中草药品"},
                component: () => import("../views/account/zcy.vue"),
            },
            // {
            //   path: "/docAdvice",
            //   meta: { path:"/docAdvice", title: '医嘱相关'},
            //   component: () => import("../views/SystemCatalogue/docAdvice/GiveWays.vue"),

            // },
        ]
    },
    //订单管理
    {
        path: "/Order",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '订单管理', path: "/Order"},
                component: () => import("../views/order/Order.vue")
            }
        ]
    },
    // 客服
    {
        path: "/customer",
        component: Layout,
        redirect: "/customer",
        meta: {path: "/customer", title: "客服"},
        children: [
            {
                path: "/customer/files",
                meta: {path: "/customer/files", title: '客户档案'},
                component: () => import("../views/customer/files/files.vue"),
            },
        ]

    },

    //患者管理
    {
        path: "/files",
        component: Layout,
        redirect: "/files/files",
        meta: {path: "/files", title: "患者管理"},
        children: [
            {
                path: "/files/files",
                meta: {path: "/files/files", title: '基本信息'},
                component: () => import("../views/files/files.vue"),
            },
            {
                path: "/files/Recharge",
                meta: {path: "/files/Recharge", title: '患者充值'},
                component: () => import("../views/files/Recharge.vue"),
            },
            {
                path: "/files/visited",
                meta: {path: "/files/visited", title: '患者回访'},
                component: () => import("../views/files/visited.vue"),
            },
            {
                path: "/files/activity",
                meta: {path: "/files/activity", title: "优惠活动"},
                component: () => import("../views/files/activity.vue"),
            },
        ]
    },
    //收费管理
    {
        path: "/charge",
        component: Layout,
        redirect: "/charge/charge",
        meta: {path: "/charge", title: "收费管理"},
        children: [
            {
                path: "/charge/charge",
                meta: {path: "/charge/charge", title: '诊疗收费'},
                component: () => import("../views/charge/charge.vue"),
            },
            {
                path: "/charge/Closing",
                meta: {path: "/charge/Closing", title: '结班管理'},
                component: () => import("../views/charge/Closing.vue"),
            }
        ]
    },
    //登记信息
    {
        path: "/register",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '登记信息', path: "/register"},
                component: () => import("../views/register/register.vue")
            }
        ]
    },
    //医生门诊
    {
        path: "/outpatient",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '医生门诊', path: "/outpatient"},
                component: () => import("../views/outpatient/outpatient.vue")
            }
        ]
    },
    //不合理处方查询
    {
        path: "/prescripQuery",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '不合理处方查询', path: "/prescripQuery"},
                component: () => import("../views/prescripQuery/prescripQuery.vue")
            }
        ]
    },
    //  顶部tabs1
    {
        path: "/Tabs1",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '暂定标签0', path: "/Tabs"},
                component: () => import("../views/tabs/Tabs1.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 收费发药 inventory
    // {
    //   path: "/PayforMedicen",
    //   component: Layout,
    //   children: [
    //     {
    //       path: "/",
    //   		  meta: { title: '收费发药', path: "/PayforMedicen" },
    //       component: () => import("../views/PayforMedicen/PayforMedicen.vue")
    //     }
    //   ]
    // },
    // 顶部tabs2-Choose 治疗 treatment
    {
        path: "/treatment",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '治疗', path: "/treatment"},
                component: () => import("../views/treatment/treatment.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 报表查询 tableQuery
    {
        path: "/tableQuery",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '报表查询', path: "/tableQuery"},
                component: () => import("../views/tableQuery/tableQuery.vue")
            }
        ]
    },
    // 顶部tabs2-Choose 库存管理 inventory
    {
        path: "/inventory",
        component: Layout,
        children: [
            {
                path: "/",
                meta: {title: '库存管理', path: "/inventory"},
                component: () => import("../views/inventory/inventory.vue")
            }
        ]
    },
    // 跳转页面 采购入库单
    {
        path: "/shopOrder",
        component: Layout,
        children: [
            {
                path: "/shopOrder",
                meta: {title: '采购入库单', path: "/shopOrder"},
                component: () => import("../external/shopStore/StoreOrder.vue")
            }
        ]
    },
    // 独立页面 工作台
    {
        path: "/workJob",
        component: Layout,
        children: [
            {
                path: "/workJob",
                meta: {title: '采购入库单', path: "/workJob"},
                component: () => import("../views/index/workJob.vue")
            }
        ]
    },
    // 测试404
    {
        path: "/test",
        component: Layout,
        children: [
            {
                path: "/test",
                meta: {title: '测试404', path: "/test"},
                component: () => import("../views/404.vue")
            }
        ]
    },
    // 跳转页面 忘记密码
    {
        path: "/forgetPassword",
        meta: {title: '忘记密码', path: "/forgetPassword"},
        component: () => import("../views/login/forgetPassword.vue")
    },
    // 跳转页面 个人中心
    {
        path: "/profile",
        component: Layout,
        children: [
            {
                path: "/profile",
                meta: {title: '个人中心', path: "/profile"},
                component: () => import("../views/account/UserInfo.vue")
            }
        ]
    },

]


const router = new VueRouter({
    routes
})


// 添加全局后置钩子
// router.afterEach((to, from) => {
//   // 设置超时判断逻辑
//   setTimeout(() => {
//     // 判断当前路由是否与to相同
//     if (router.currentRoute.path === to.path) {
//       // 执行超时后的操作，例如显示一个错误提示或者进行页面跳转
//       // console.log('登录超时');
// 	  this.$message('长时间未操作，请重新登录！', '系统提示', {
// 		confirmButtonText: '确定',
// 		callback: action => {
// 		  router.push('/login'); // 可以选择跳转到一个超时错误页面
// 		}
// 	  });

//     }
//   }, 5000); // 设置超时时间为5秒
// });

//水印哈希码
const generateHash = (text) => {
    let hash = 0
    for (let i = 0; i < text.length; i++) {
        hash = ((hash << 5) - hash) + text.charCodeAt(i)
        hash |= 0 // 转换为32位整数
    }
    return hash.toString()
}
// 修改后的水印验证函数，返回验证结果
const checkWatermark = () => {
    try {
        const part1 = sessionStorage.getItem('w_part1')
        const part2 = localStorage.getItem('w_part2')
        const part3 = sessionStorage.getItem('w_part3')
        const storedHash = localStorage.getItem('w_hash')

        if (part1 && part2 && part3 && storedHash) {
            const watermarkText = `${part1}-${part2}-${part3}`
            if (generateHash(watermarkText) === storedHash) {
                watermark.set(watermarkText)
                return true // 验证通过
            }
        }
        watermark.set('水印已被篡改')
        return false // 验证失败
    } catch (e) {
        console.error('水印验证失败:', e)
        watermark.set('水印已被篡改')
        return false // 验证失败
    }
}
const clearWatermarkData = () => {
    try {
        // 清除所有水印存储
        sessionStorage.removeItem('w_part1');
        localStorage.removeItem('w_part2');
        sessionStorage.removeItem('w_part3');
        localStorage.removeItem('w_hash');

        // 清除水印显示
        if (watermark && typeof watermark.clear === 'function') {
            watermark.clear();
        } else {
            // 备用清除方法
            const watermarkElements = document.querySelectorAll('[id^="watermark-"]');
            watermarkElements.forEach(el => el.remove());
        }
    } catch (e) {
        console.error('清理水印数据失败:', e);
    }
};

// 全局前置守卫
router.beforeEach((to, from, next) => {
    //from
    //to
    //next 放行
	// 检查是否登录过期
	  if (checkLoginExpiry()) {
		clearAuth()
		next('/login')
		Vue.prototype.$message.error('登录已超时，请重新登录')
		return
	  }
    //判断本地存储是否有token，如果有就直接放行，否则返回登录页面。
    let isLogin = localStorage.getItem("token") ? true : false;
    if (isLogin) {
        next()
    } else {
        if (to.path == '/login') {
            next()
        } else {
            next(`/login?redirect=${to.path}`)
        }

    }

})

//暴露路由对象
export default router
